/*
 * Copyright 2014 NAVER Corp.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.ideal.ete.collector.application;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * 
 * @author netspider
 * @author emeroad
 * @author jaehong.kim
 * 
 */
//@JsonSerialize(using = CenterInfoSerializer.class)
public final class CenterInfo {
    private  String center;
    private  ApplicationType applicationType;
    private  String agentId;
    private  long timeStamp;
	public CenterInfo() {
		super();
		// TODO Auto-generated constructor stub
	}
	public CenterInfo(String center, ApplicationType applicationType, String agentId, long timeStamp) {
		super();
		this.center = center;
		this.applicationType = applicationType;
		this.agentId = agentId;
		this.timeStamp = timeStamp;
	}
	public String getCenter() {
		return center;
	}
	public void setCenter(String center) {
		this.center = center;
	}
	public ApplicationType getApplicationType() {
		return applicationType;
	}
	public void setApplicationType(ApplicationType applicationType) {
		this.applicationType = applicationType;
	}
	public String getAgentId() {
		return agentId;
	}
	public void setAgentId(String agentId) {
		this.agentId = agentId;
	}
	public long getTimeStamp() {
		return timeStamp;
	}
	public void setTimeStamp(long timeStamp) {
		this.timeStamp = timeStamp;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((agentId == null) ? 0 : agentId.hashCode());
		result = prime * result + ((applicationType == null) ? 0 : applicationType.hashCode());
		result = prime * result + ((center == null) ? 0 : center.hashCode());
		result = prime * result + (int) (timeStamp ^ (timeStamp >>> 32));
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CenterInfo other = (CenterInfo) obj;
		if (agentId == null) {
			if (other.agentId != null)
				return false;
		} else if (!agentId.equals(other.agentId))
			return false;
		if (applicationType == null) {
			if (other.applicationType != null)
				return false;
		} else if (!applicationType.equals(other.applicationType))
			return false;
		if (center == null) {
			if (other.center != null)
				return false;
		} else if (!center.equals(other.center))
			return false;
		if (timeStamp != other.timeStamp)
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "CenterInfo [center=" + center + ", applicationType=" + applicationType + ", agentId=" + agentId
				+ ", timeStamp=" + timeStamp + "]";
	}
	

   
}
